<?php


class Uniform_Abstract implements ArrayAccess
{
	var $_cache = array();
	var $service;
	var $what;

	public function __construct ($service, $what)
	{
		$this->service = $service;
		$this->what = $what;
	} // end of __construct

	public function what ()
	{
		return $this->what;
	} // end of method getOid

	public function offsetGet ($k)
	{
		if (array_key_exists($k, $this->_cache)) return $this->_cache[$k];
		$mn = str_replace('_', '', $k);
		if (method_exists($this,$mn)) return $this->_cache[$k] = $this->$mn();
		return NULL;
	} // end of method getOffset
	public function offsetSet ($k, $v)
	{
		$this->_cache[$k] = $v;
	} // end of method setOffset
	public function offsetExists ($k)
	{
		$mn = str_replace($k, '_', '');
		return method_exists($this,$mn) || array_key_exists($k, $this->_cache);
	} // end of method offsetExists
	public function offsetUnset ($k)
	{
		unset($this->_cache[$k]);
	} // end of method offsetUnset

	public function __toString ()
	{
		return get_class($this);
	} // end of method __toString

}

